class CallForPapers:
    def __init__(self, title="", text=""):
        self.title = title
        self.text = text

    def get_text(self):
        return f"Title: {self.title}\nContent: {self.text}"


class ResearchContent:
    def __init__(self, title="", text=""):
        self.title = title
        self.text = text

    def get_text(self):
        return f"Title: {self.title}\nText: {self.text}"


class Matcher:
    def __init__(self, llm):
        self.llm = llm

    def get_similarity(self, prompt):
        return self.llm.get_similarity(prompt)


def match_call_for_papers(matcher, call_for_papers, research_content):
    # 将征稿信息和用户已有的研究内容转换为文本格式
    call_for_papers_text = call_for_papers.get_text()
    research_content_text = research_content.get_text()

    # 构建匹配分析的提示
    prompt = f"征稿信息：{call_for_papers_text}\n研究内容：{research_content_text}\n匹配分析："

    # 获取匹配分析结果
    match_analysis = matcher.get_similarity(prompt)

    # 输出匹配分析结果
    print(match_analysis)

    # 判断是否符合投稿要求
    if "符合" in match_analysis:
        return True
    else:
        return False


if __name__ == '__main__':
    cfp = CallForPapers(title="test", text="test coding")
    print(cfp.get_text())
